<?php
	include("admin-commons.php");

	$user = $_COOKIE['user'];
	$hash = $_COOKIE['hash'];
	if(strlen($user) == 0)
	{
		echo "<html>\n";
		echo "<h2>PEBKAC Error: You must be logged in to logout!</h2>\n";
	} else {
		setcookie("user", "", time()-3600);
		setcookie("hash", "", time()-3600);
		echo "<html>\n";
		echo "<h2>You have been logged out.</h2>";
	}
	echo "Click <a href=\"login.php\"> here</a> to log in again.";
	echo "</html>";
?>